﻿@using VirtualPress.Infrastructure.Entities.Entity
@{
    ViewBag.Title = "图书编辑";
}
<div id="content-header">
    <h1>
        图书管理</h1>
</div>
<div id="breadcrumb">
    <a href="/WorkSpace/press/index" class="tip-bottom"><i class="icon-home"></i>起始页</a> <a href="/WorkSpace/Press/Books">
        图书管理</a> <a href="/WorkSpace/Press/Books">所有图书</a> <a class="current">图书编辑</a>
</div>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon"><i class="icon-book"></i></span>
                    <h5>
                        图书编辑</h5>
                </div>
                @{
                    Book book = ViewBag.Book;
                }
                <div class="widget-content nopadding">
                    <form class="form-horizontal" method="post" action="/workspace/press/bookedit" name="basic_validate"
                    enctype="multipart/form-data">
                    <input type="hidden" name="id" value="@book.Id" />
                    <div class="control-group">
                        <label class="control-label">
                            书 名</label>
                        <div class="controls">
                            <input type="text" name="name" value="@book.Name" placeholder="图书名称" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            作 者</label>
                        <div class="controls">
                            <input type="text" placeholder="图书作者" name="Authors" value="@book.Authors"/>
                            <span class="help-block">多个作者请用英文逗号","隔开</span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            译 者</label>
                        <div class="controls">
                            <input type="text" placeholder="图书译者" name="Translator" value="@book.Translator" />
                            <span class="help-block">多个译者请用英文逗号","隔开</span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            出版社</label>
                        <div class="controls">
                            <input type="text" placeholder="非本出版社书籍需审核" name="Press" value="@book.Press"
                                value="中华科教出版社" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            ISBN</label>
                        <div class="controls">
                            <input type="text" placeholder="图书ISBN号" name="ISBN" value="@book.ISBN" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            发售范围</label>
                        <div class="controls">
                            <select style="width: 81%" name="FXFW">
                                <option value="中国大陆地区">中国大陆地区</option>
                                <option value="港澳台地区">港澳台地区</option>
                                <option value="全球">全球</option>
                            </select>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            版 次</label>
                        <div class="controls">
                            <input type="text" placeholder="图书版次" name="BC" value="@book.BC"/>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            印 次</label>
                        <div class="controls">
                            <input type="text" placeholder="图书印次" name="YC" value="@book.YC"/>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            开 本</label>
                        <div class="controls">
                            <input type="text" placeholder="图书开本" name="KB" value="@book.KB" />
                            <span class="help-block">例：787mm×1092mm 1/16</span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            印 张</label>
                        <div class="controls">
                            <input type="text" placeholder="图书印张" name="Pages" value="@book.Pages" class="{digits:true}" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            字 数</label>
                        <div class="controls">
                            <div class="input-append">
                                <input class="span2 {digits:true}" type="text" value="@book.Characters" name="Characters" placeholder="图书字数" />
                                <span class="add-on">千字</span>
                            </div>
                        </div>
                    </div>
                      <div class="control-group">
                        <label class="control-label">
                            出版时间</label>
                        <div class="controls">
                            <div id="boxpubdate" class="input-append">
                            <input class="{required:true,dateISO:true}" data-format="yyyy-MM-dd" type="text"  name="PubDate" value="@book.PubDate.ToString("yyyy-MM-dd")"/>
                            <span class="add-on">
                                <i class="icon-calendar" data-time-icon="icon-time" data-date-icon="icon-calendar" ></i>
                            </span>
                        </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            印刷时间</label>
                        <div class="controls">
                            <div id="boxprtdate" class="input-append">
                            <input class="{required:true,dateISO:true}" data-format="yyyy-MM-dd" type="text"  name="PrintDate" value="@book.PrintDate.ToString("yyyy-MM-dd")"/>
                            <span class="add-on">
                                <i class="icon-calendar" data-time-icon="icon-time" data-date-icon="icon-calendar" ></i>
                            </span>
                        </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            包装</label>
                        <div class="controls">
                            <input type="text" placeholder="包装" name="Pack" value="@book.Pack" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            承印者</label>
                        <div class="controls">
                            <input type="text" placeholder="图书承印单位" name="CYZ" value="@book.CYZ" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            定 价</label>
                        <div class="controls">
                            <div class="input-append">
                                <input type="text" placeholder="图书定价" name="Price" value="@book.Price" class="{number:true}" />
                                <span class="add-on">元</span>
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            简 介</label>
                        <div class="controls">
                            <script name="Introduction" id="txtIntroduction" type="text/plain">@Html.Raw(book.Introduction)</script>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            书籍内容</label>
                        <div class="controls">
                            <script name="Content" id="txtContent" type="text/plain">@Html.Raw(book.Content)</script>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            作者简介</label>
                        <div class="controls">
                            <script name="AboutAuthor" id="txtAboutAuthor" type="text/plain">@Html.Raw(book.AboutAuthor)</script>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            媒体评论</label>
                        <div class="controls">
                            <script name="Comments" id="txtComments" type="text/plain">@Html.Raw(book.Comments)</script>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            购买方式</label>
                        <div class="controls">
                            <input type="text" placeholder="本平台暂不支持在线购买，请录入购买方式提示" name="Buy" value="@book.Buy"/>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            图书封面</label>
                        <div class="controls">
                            <input type="file" name="fileControll" class="{accept:'jpg|png'}" />
                            <span class="help-block">封面图片要求：文件大小小于50K，高宽比例介于1.4-1.6之间</span>
                            @if (!String.IsNullOrEmpty(book.CoverImg)) 
                            { 
                                <img alt="@book.Name" style="width:130px;height:170px" src="@book.CoverImg" />
                            }
                        </div>
                    </div>
                    <div class="form-actions">
                        <a href="/WorkSpace/Press/Books" class="btn">返 回</a> 
                        <input type="submit" class="btn btn-primary" value="保 存" />
                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@section tail{
    <script type="text/javascript" charset="utf-8" src="/Scripts/UEditor/editor_config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/Scripts/UEditor/editor_all_min.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#boxpubdate').datetimepicker({
                pickTime: false
            });
            $('#boxprtdate').datetimepicker({
                pickTime: false
            });
            UE.getEditor('txtIntroduction');
            UE.getEditor('txtContent');
            UE.getEditor('txtAboutAuthor');
            UE.getEditor('txtComments');
            $('#likbook').addClass('active open');
            $('select[name="FXFW"]').val('@book.FXFW');
        });
    </script>
}
